package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.newpartsmanage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface newpartsmanageMapper extends BaseMapper<newpartsmanage> {
    @Insert("insert into view_newpartsmanage(mmcode,SPAcode,smcode,cname,model,num,company,uprice,wtime,dtime,ukey,wfkey) " +
            "value(#{mmcode},#{SPAcode},#{smcode},#{cname},#{model},#{num},#{company},#{uprice},#{wtime},#{dtime},#{ukey},#{wfkey})")
    public int Storage(newpartsmanage newpartsmanage);

    @Select("select * from newpartsmanage where newkey=#{newkey}")
    public List<newpartsmanage> selectNewkey(newpartsmanage newpartsmanage);

    @Update("update view_newpartsmanage set dtime=#{dtime} where newkey=#{newkey}")
    public int Outbound(int newkey, String dtime);

    @Update("update view_newpartsmanage set mmcode=#{mmcode},SPAcode=#{SPAcode},smcode=#{smcode},cname=#{cname}," +
            "model=#{model},num=#{num},company=#{company},uprice=#{uprice},wtime=#{wtime},dtime=#{dtime},ukey=#{ukey},wfkey=#{wfkey} " +
            "where newkey=#{newkey}")
    public int updatenewpartsmanage(newpartsmanage newpartsmanage);
}
